Purpose
SLURM scripts created or edited on Windows may use Windows line endings. MSI runs Linux, which expects Unix line endings in shell scripts. Before submitting a Windows-edited .sh file to MSI, convert it with dos2unix.
This issue usually does not affect SLURM scripts created or edited on macOS, because macOS normally uses Unix-style line endings.
Install dos2unix on Windows
This installation is a one-time setup on the Windows machine.
Open Terminal or PowerShell and run:
winget install waterlan.dos2unixClose the terminal, then open a new Terminal or PowerShell window so the command is available.
Convert a SLURM Script
Go to the local course or project repository:
cd path/to/your/local/repositoryConvert the script:
dos2unix runmod.shReplace runmod.sh with the name of the SLURM script you edited.
When to Run It
Run dos2unix every time a .sh file is edited and saved on Windows before submitting it to MSI.
Example:
dos2unix my_slurm_script.sh
sbatch my_slurm_script.shQuick Check
If a Linux submission fails with unexpected shell-script errors, hidden Windows line endings may be the cause. Re-run dos2unix on the .sh file, then submit again.